﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using HMP.GUI;
using HMP.DA;
using System.Windows.Forms;
namespace HMP.BL
{
    class CheckLoginBL
    {
        public static bool KTTonTai(string username, string password)
        {
            using (QLTTBNEntities context = new QLTTBNEntities())
            {
                bool check = true;
                var query = from p in context.tbUsers select p; ;
                foreach (var row in query)
                {
                    if (row.UserID == username && row.Password == password)
                    {
                        check = true;
                        break;
                    }
                    else
                        check = false;
                }
                return check;
            }

        }
    }
}